import Vue from 'vue'
import Vuex from 'vuex'
import baseHttp from "@/axios/baseHttp.js"
Vue.use(Vuex)
export default new Vuex.Store({
    state:{
        menuList:[]
    },
    mutations:{
        /**获取menu菜单列表 */
        changeMenuList(state, list) {
            state.menuList = list;
        }
    },
    actions:{
        changeMenuList(context) {
            baseHttp.getMenuByUser().then(res => {
                context.commit('changeMenuList', res.content);
            })
        }
    }
})
